package com.zr.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * 点击节点请求的controller层，设置request的tid属性为节点id，再转发到main.jsp页面
 * @author Administrator
 *
 */
public class IndexController extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		
		String tid = req.getParameter("tid");
		req.setAttribute("tid", tid);
		
		req.getRequestDispatcher("main.jsp").forward(req, resp);
		
	}
	
}
